package com.example.Laboratory.Service.Impl;


import com.example.Laboratory.Entity.Instrument;
import com.example.Laboratory.Mapper.InstrumentMapper;
import com.example.Laboratory.Service.InstrumentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Service
public class InstrumentServiceImpl implements InstrumentService {


    @Autowired
    InstrumentMapper instrumentMapper;


    //增加实验室概况设备
    @Override
    public String addInstrument(Instrument t) {
        if (instrumentMapper.addInstrument(t) == 1) {

            return "添加成功";
        } else {
            return "添加失败";
        }
    }


    //查找实验室概况设备全表
    @Override
    public List<Instrument> selectInstrumentAll() {
        return instrumentMapper.selectInstrumentAll();
    }

    //删除实验室概况设备
    @Override
    public String deleteInstrument(int instrument_id) {
        if (instrumentMapper.deleteInstrument(instrument_id) == 1) {
            return "删除成功";
        } else {
            return "删除失败";
        }
    }

    //修改实验室概况设备
    @Override
    public String updateInstrument(Instrument i) {
        if (instrumentMapper.updateInstrument(i) == 1) {
            return "修改成功";
        } else {
            return "修改失败";
        }
    }
}
